<!doctype html><html lang="en">
 <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  <title>CSS Scroll Anchoring Module Level 1</title>
  <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
  <meta content="revising" name="csswg-work-status">
  <meta content="ED" name="w3c-status">
  <meta content="Changes in DOM elements above the visible region of a <a>scrolling box</a> can result in the page moving  while the user is in the middle of consuming the content.    This spec proposes a mechanism to mitigate this jarring user experience  by keeping track of the position of an anchor node and adjusting the scroll offset accordingly.    This spec also proposes an API for web developers to opt-out of this behavior." name="abstract">
  <link href="../default.css" rel="stylesheet" type="text/css">
  <link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
  body {
    background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat;
  }
  </style>
  <link href="https://drafts.csswg.org/css-scroll-anchoring" rel="canonical">
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
   regarding paragraph and lists. */
[data-md] > :first-child {
    margin-top: 0;
}
[data-md] > :last-child {
    margin-bottom: 0;
}</style>
<style>/* style-selflinks */

.heading, .issue, .note, .example, li, dt {
    position: relative;
}
a.self-link {
    position: absolute;
    top: 0;
    left: calc(-1 * (3.5rem - 26px));
    width: calc(3.5rem - 26px);
    height: 2em;
    text-align: center;
    border: none;
    transition: opacity .2s;
    opacity: .5;
}
a.self-link:hover {
    opacity: 1;
}
.heading > a.self-link {
    font-size: 83%;
}
li > a.self-link {
    left: calc(-1 * (3.5rem - 26px) - 2em);
}
dfn > a.self-link {
    top: auto;
    left: auto;
    opacity: 0;
    width: 1.5em;
    height: 1.5em;
    background: gray;
    color: white;
    font-style: normal;
    transition: opacity .2s, background-color .2s, color .2s;
}
dfn:hover > a.self-link {
    opacity: 1;
}
dfn > a.self-link:hover {
    color: black;
}

a.self-link::before            { content: "¶"; }
.heading > a.self-link::before { content: "§"; }
dfn > a.self-link::before      { content: "#"; }</style>
<style>/* style-counters */

body {
    counter-reset: example figure issue;
}
.issue {
    counter-increment: issue;
}
.issue:not(.no-marker)::before {
    content: "Issue " counter(issue);
}

.example {
    counter-increment: example;
}
.example:not(.no-marker)::before {
    content: "Example " counter(example);
}
.invalid.example:not(.no-marker)::before,
.illegal.example:not(.no-marker)::before {
    content: "Invalid Example" counter(example);
}

figcaption {
    counter-increment: figure;
}
figcaption:not(.no-marker)::before {
    content: "Figure " counter(figure) " ";
}</style>
<style>/* style-var-click-highlighting */

    var { cursor: pointer; }
    var.selected0 { background-color: #F4D200; box-shadow: 0 0 0 2px #F4D200; }
    var.selected1 { background-color: #FF87A2; box-shadow: 0 0 0 2px #FF87A2; }
    var.selected2 { background-color: #96E885; box-shadow: 0 0 0 2px #96E885; }
    var.selected3 { background-color: #3EEED2; box-shadow: 0 0 0 2px #3EEED2; }
    var.selected4 { background-color: #EACFB6; box-shadow: 0 0 0 2px #EACFB6; }
    var.selected5 { background-color: #82DDFF; box-shadow: 0 0 0 2px #82DDFF; }
    var.selected6 { background-color: #FFBCF2; box-shadow: 0 0 0 2px #FFBCF2; }
    </style>
<style>/* style-autolinks */

.css.css, .property.property, .descriptor.descriptor {
    color: #005a9c;
    font-size: inherit;
    font-family: inherit;
}
.css::before, .property::before, .descriptor::before {
    content: "‘";
}
.css::after, .property::after, .descriptor::after {
    content: "’";
}
.property, .descriptor {
    /* Don't wrap property and descriptor names */
    white-space: nowrap;
}
.type { /* CSS value <type> */
    font-style: italic;
}
pre .property::before, pre .property::after {
    content: "";
}
[data-link-type="property"]::before,
[data-link-type="propdesc"]::before,
[data-link-type="descriptor"]::before,
[data-link-type="value"]::before,
[data-link-type="function"]::before,
[data-link-type="at-rule"]::before,
[data-link-type="selector"]::before,
[data-link-type="maybe"]::before {
    content: "‘";
}
[data-link-type="property"]::after,
[data-link-type="propdesc"]::after,
[data-link-type="descriptor"]::after,
[data-link-type="value"]::after,
[data-link-type="function"]::after,
[data-link-type="at-rule"]::after,
[data-link-type="selector"]::after,
[data-link-type="maybe"]::after {
    content: "’";
}

[data-link-type].production::before,
[data-link-type].production::after,
.prod [data-link-type]::before,
.prod [data-link-type]::after {
    content: "";
}

[data-link-type=element],
[data-link-type=element-attr] {
    font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
    font-size: .9em;
}
[data-link-type=element]::before { content: "<" }
[data-link-type=element]::after  { content: ">" }

[data-link-type=biblio] {
    white-space: pre;
}</style>
<style>/* style-dfn-panel */

.dfn-panel {
    position: absolute;
    z-index: 35;
    height: auto;
    width: -webkit-fit-content;
    width: fit-content;
    max-width: 300px;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: #DDDDDD;
    color: black;
    border: outset 0.2em;
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: black; }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0; }
.dfn-panel li { list-style: inside; }
.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: .5em;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
}

.dfn-paneled { cursor: pointer; }
</style>
 <body class="h-entry">
  <div class="head">
   <p data-fill-with="logo"><a class="logo" href="https://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/StyleSheets/TR/2016/logos/W3C" width="72"> </a> </p>
   <h1 class="p-name no-ref" id="title">CSS Scroll Anchoring Module Level 1</h1>
   <h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="1970-01-01">1 January 1970</time></span></h2>
   <details>
    <summary>Specification Metadata</summary>
    <div data-fill-with="spec-metadata">
     <dl>
      <dt>This version:
      <dd><a class="u-url" href="https://drafts.csswg.org/css-scroll-anchoring">https://drafts.csswg.org/css-scroll-anchoring</a>
      <dt class="editor">Editors:
      <dd class="editor p-author h-card vcard"><span class="p-name fn">Steve Kobes</span> (<span class="p-org org">Google</span>)
      <dd class="editor p-author h-card vcard" data-editor-id="42199"><a class="p-name fn u-url url" href="http://xanthir.com/contact/">Tab Atkins-Bittner</a> (<span class="p-org org">Google</span>)
      <dt>Suggest an Edit for this Spec:
      <dd><a href="https://github.com/w3c/csswg-drafts/blob/master/css-scroll-anchoring-1/Overview.bs">GitHub Editor</a>
      <dt>Issue Tracking:
      <dd><a href="https://github.com/w3c/csswg-drafts/labels/css-scroll-anchoring-1">GitHub Issues</a>
     </dl>
    </div>
   </details>
   <div data-fill-with="warning"></div>
   <p class="copyright" data-fill-with="copyright"><a href="https://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 1970 <a href="https://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a href="https://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="https://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>, <a href="https://www.keio.ac.jp/">Keio</a>, <a href="https://ev.buaa.edu.cn/">Beihang</a>). W3C <a href="https://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="https://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document">permissive document license</a> rules apply. </p>
   <hr title="Separator for header">
  </div>
  <div class="p-summary" data-fill-with="abstract">
   <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
   <p>Changes in DOM elements above the visible region of a <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-view-1/#scrolling-box" id="ref-for-scrolling-box">scrolling box</a> can result in the page moving

while the user is in the middle of consuming the content.</p>
   <p>This spec proposes a mechanism to mitigate this jarring user experience

by keeping track of the position of an anchor node and adjusting the scroll offset accordingly.</p>
   <p>This spec also proposes an API for web developers to opt-out of this behavior.</p>
    <a href="https://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc. 
  </div>
  <h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
  <div data-fill-with="status">
   <p> This is a public copy of the editors’ draft.
	It is provided for discussion only and may change at any moment.
	Its publication here does not imply endorsement of its contents by W3C.
	Don’t cite this document other than as work in progress. </p>
   <p> <a href="https://github.com/w3c/csswg-drafts/issues">GitHub Issues</a> are preferred for discussion of this specification.
	When filing an issue, please put the text “css-scroll-anchoring” in the title,
	preferably like this:
	“[css-scroll-anchoring] <i data-lt>…summary of comment…</i>”.
	All issues and comments are <a href="https://lists.w3.org/Archives/Public/public-css-archive/">archived</a>,
	and there is also a <a href="https://lists.w3.org/Archives/Public/www-style/">historical archive</a>. </p>
   <p> This document was produced by the <a href="https://www.w3.org/Style/CSS/">CSS Working Group</a>. </p>
   <p> This document was produced by a group operating under
	the <a href="https://www.w3.org/Consortium/Patent-Policy/">W3C Patent Policy</a>.
	W3C maintains a <a href="https://www.w3.org/2004/01/pp-impl/32061/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group;
	that page also includes instructions for disclosing a patent.
	An individual who has actual knowledge of a patent which the individual believes contains <a href="https://www.w3.org/Consortium/Patent-Policy/#def-essential">Essential Claim(s)</a> must disclose the information in accordance with <a href="https://www.w3.org/Consortium/Patent-Policy/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
   <p> This document is governed by the <a href="https://www.w3.org/2019/Process-20190301/" id="w3c_process_revision">1 March 2019 W3C Process Document</a>. </p>
   <p></p>
  </div>
  <div data-fill-with="at-risk"></div>
  <nav data-fill-with="table-of-contents" id="toc">
   <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
   <ol class="toc" role="directory">
    <li><a href="#intro"><span class="secno">1</span> <span class="content"> Introduction</span></a>
    <li>
     <a href="#description"><span class="secno">2</span> <span class="content"> Description</span></a>
     <ol class="toc">
      <li><a href="#anchor-node-selection"><span class="secno">2.1</span> <span class="content"> Anchor Node Selection</span></a>
      <li>
       <a href="#scroll-adjustment"><span class="secno">2.2</span> <span class="content"> Scroll Adjustment</span></a>
       <ol class="toc">
        <li><a href="#suppression-windows"><span class="secno">2.2.1</span> <span class="content"> Suppression Window</span></a>
        <li><a href="#suppression-triggers"><span class="secno">2.2.2</span> <span class="content"> Suppression Triggers</span></a>
       </ol>
     </ol>
    <li><a href="#exclusion-api"><span class="secno">3</span> <span class="content"> Exclusion API</span></a>
    <li><a href="#priv-sec"><span class="secno">4</span> <span class="content"> Privacy and Security Considerations</span></a>
    <li>
     <a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
     <ol class="toc">
      <li><a href="#document-conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
      <li><a href="#conform-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
      <li>
       <a href="#conform-responsible"><span class="secno"></span> <span class="content"> Requirements for Responsible Implementation of CSS</span></a>
       <ol class="toc">
        <li><a href="#conform-partial"><span class="secno"></span> <span class="content"> Partial Implementations</span></a>
        <li><a href="#conform-future-proofing"><span class="secno"></span> <span class="content"> Implementations of Unstable and Proprietary Features</span></a>
        <li><a href="#conform-testing"><span class="secno"></span> <span class="content"> Implementations of CR-level Features</span></a>
       </ol>
     </ol>
    <li>
     <a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
     <ol class="toc">
      <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
      <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
     </ol>
    <li>
     <a href="#references"><span class="secno"></span> <span class="content">References</span></a>
     <ol class="toc">
      <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
     </ol>
    <li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
   </ol>
  </nav>
  <main>
   <h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content"> Introduction</span><a class="self-link" href="#intro"></a></h2>
   <p>Today, users of the web are often distracted by content moving around
due to changes that occur outside the viewport.
Examples include script inserting an iframe containing an ad,
or non-sized images loading on a slow network.</p>
   <p>Historically the browser’s default behavior has been
to preserve the absolute scroll position when such changes occur.
This means that to avoid shifting content,
the webpage can attempt to reserve space on the page
for anything that will load later.
In practice, few websites do this consistently.</p>
   <p>Scroll anchoring aims to minimize surprising content shifts.
It does this by adjusting the scroll position
to compensate for the changes outside the viewport.</p>
   <p>The <a href="https://github.com/WICG/ScrollAnchoring/blob/master/explainer.md">explainer document</a> gives an informal overview of scroll anchoring.</p>
   <h2 class="heading settled" data-level="2" id="description"><span class="secno">2. </span><span class="content"> Description</span><a class="self-link" href="#description"></a></h2>
   <p>Scroll anchoring works by selecting a DOM node (the <dfn class="dfn-paneled" data-dfn-for="scroll-anchoring" data-dfn-type="dfn" data-export id="scroll-anchoring-anchor-node">anchor node</dfn>)
whose movement is used to determine adjustments to the scroll position.</p>
   <h3 class="heading settled" data-level="2.1" id="anchor-node-selection"><span class="secno">2.1. </span><span class="content"> Anchor Node Selection</span><a class="self-link" href="#anchor-node-selection"></a></h3>
   <p>Each <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-view-1/#scrolling-box" id="ref-for-scrolling-box①">scrolling box</a> aims to select an <a data-link-type="dfn" href="#scroll-anchoring-anchor-node" id="ref-for-scroll-anchoring-anchor-node">anchor node</a> that is deep in the DOM
and close to the block start edge of its <a data-link-type="dfn" href="https://drafts.csswg.org/css-scroll-snap-1/#optimal-viewing-region" id="ref-for-optimal-viewing-region">optimal viewing region</a>.</p>
   <p class="note" role="note"><span>Note:</span> If the user agent does not support the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding" id="ref-for-propdef-scroll-padding">scroll-padding</a> property,
the optimal viewing region of the scrolling box is equivalent to its <a data-link-type="dfn" href="https://drafts.csswg.org/css-box-3/#content-area" id="ref-for-content-area">content area</a>.</p>
   <p>The anchor node is either a non-anonymous <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#block-box" id="ref-for-block-box">block box</a> or a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#text-nodes" id="ref-for-text-nodes">text node</a>.
The anchor node is always a <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-tree-descendant" id="ref-for-concept-tree-descendant">descendant</a> of the <a data-link-type="dfn" href="https://drafts.csswg.org/cssom-view-1/#scrolling-box" id="ref-for-scrolling-box②">scrolling box</a>.
In some cases, a scrolling box may not select any anchor node.</p>
   <div class="algorithm" data-algorithm="anchor node selection algorithm">
     The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="anchoring-algorithm">anchor node selection algorithm</dfn> for a scrolling box <var>S</var> is as follows: 
    <ol>
     <li data-md>
      <p>If <var>S</var> is associated with an element
whose computed value of the <a class="property" data-link-type="propdesc" href="#propdef-overflow-anchor" id="ref-for-propdef-overflow-anchor">overflow-anchor</a> property is <a class="css" data-link-type="maybe" href="#valdef-overflow-anchor-none" id="ref-for-valdef-overflow-anchor-none">none</a>,
then do not select an anchor node for <var>S</var>.</p>
     <li data-md>
      <p>Otherwise, for each DOM child <var>N</var> of the element or document associated with <var>S</var>,
perform the <a data-link-type="dfn" href="#candidate-examination" id="ref-for-candidate-examination">candidate examination algorithm</a> for <var>N</var> in <var>S</var>,
and terminate if it selects an anchor node.</p>
    </ol>
   </div>
   <div class="algorithm" data-algorithm="candidate examination algorithm">
     The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="candidate-examination">candidate examination algorithm</dfn> for a candidate DOM node <var>N</var> in a scrolling box <var>S</var> is as follows: 
    <ol>
     <li data-md>
      <p>If <var>N</var> is an <a data-link-type="dfn" href="#excluded-subtree" id="ref-for-excluded-subtree">excluded subtree</a>,
or if <var>N</var> is <a data-link-type="dfn" href="#fully-clipped" id="ref-for-fully-clipped">fully clipped</a> in <var>S</var>,
then do nothing (<var>N</var> and its descendants are skipped).</p>
     <li data-md>
      <p>If <var>N</var> is <a data-link-type="dfn" href="#fully-visible" id="ref-for-fully-visible">fully visible</a> in <var>S</var>,
select <var>N</var> as the anchor node.</p>
     <li data-md>
      <p>If N is <a data-link-type="dfn" href="#partially-visible" id="ref-for-partially-visible">partially visible</a>:</p>
      <ol>
       <li data-md>
        <p>For each DOM child <var>C</var> of <var>N</var>,
perform the <a data-link-type="dfn" href="#candidate-examination" id="ref-for-candidate-examination①">candidate examination algorithm</a> for <var>C</var> in <var>S</var>,
and terminate if it selects an anchor node.</p>
       <li data-md>
        <p>For each absolutely-positioned element <var>A</var> whose <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block" id="ref-for-containing-block">containing block</a> is <var>N</var>,
but whose DOM parent is not <var>N</var>,
perform the <a data-link-type="dfn" href="#candidate-examination" id="ref-for-candidate-examination②">candidate examination algorithm</a> for <var>A</var> in <var>S</var>,
and terminate if it selects an anchor node.</p>
       <li data-md>
        <p>Select <var>N</var> as the anchor node.
(If this step is reached,
no suitable anchor node was found among <var>N</var>’s descendants.)</p>
      </ol>
      <p class="note" role="note"><span>Note:</span> Deeper nodes are preferred to minimize the possibility of content changing
inside the anchor node but outside the viewport, which would cause visible
content to shift without triggering any scroll anchoring adjustment.</p>
    </ol>
   </div>
   <p>Conceptually, a new anchor node is computed for every scrolling box
whenever the scroll position of any scrolling box changes.
(As a performance optimization,
the implementation may wait until the anchor node is needed before computing it.)</p>
   <div class="algorithm" data-algorithm="excluded subtree">
     A DOM node <var>N</var> is an <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="excluded-subtree">excluded subtree</dfn> if it is an element and any of the following conditions holds: 
    <ul>
     <li data-md>
      <p><var>N</var>’s computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>.</p>
     <li data-md>
      <p><var>N</var>’s computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-position" id="ref-for-propdef-position">position</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-position-3/#valdef-position-fixed" id="ref-for-valdef-position-fixed">fixed</a>.</p>
     <li data-md>
      <p><var>N</var>’s computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-position" id="ref-for-propdef-position①">position</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-position-3/#valdef-position-absolute" id="ref-for-valdef-position-absolute">absolute</a> and <var>N</var>’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#containing-block" id="ref-for-containing-block①">containing block</a> is an ancestor of the scrolling box.</p>
     <li data-md>
      <p><var>N</var>’s computed value of the <a class="property" data-link-type="propdesc" href="#propdef-overflow-anchor" id="ref-for-propdef-overflow-anchor①">overflow-anchor</a> property is <a class="css" data-link-type="maybe" href="#valdef-overflow-anchor-none" id="ref-for-valdef-overflow-anchor-none①">none</a>.</p>
    </ul>
   </div>
   <div class="algorithm" data-algorithm="fully visible"> A DOM node <var>N</var> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="fully-visible">fully visible</dfn> in a scrolling box <var>S</var> if <var>N</var>’s <a data-link-type="dfn" href="#scroll-anchoring-bounding-rect" id="ref-for-scroll-anchoring-bounding-rect">scroll anchoring bounding rect</a> is entirely within the <a data-link-type="dfn" href="https://drafts.csswg.org/css-scroll-snap-1/#optimal-viewing-region" id="ref-for-optimal-viewing-region①">optimal viewing region</a> of <var>S</var>. </div>
   <div class="algorithm" data-algorithm="fully clipped"> A DOM node <var>N</var> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="fully-clipped">fully clipped</dfn> in a scrolling box <var>S</var> if <var>N</var>’s <a data-link-type="dfn" href="#scroll-anchoring-bounding-rect" id="ref-for-scroll-anchoring-bounding-rect①">scroll anchoring bounding rect</a> is entirely outside the <a data-link-type="dfn" href="https://drafts.csswg.org/css-scroll-snap-1/#optimal-viewing-region" id="ref-for-optimal-viewing-region②">optimal viewing region</a> of <var>S</var>. </div>
   <div class="algorithm" data-algorithm="partially visible"> A DOM node <var>N</var> is <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="partially-visible">partially visible</dfn> in a scrolling box <var>S</var> if <var>N</var> is neither <a data-link-type="dfn" href="#fully-visible" id="ref-for-fully-visible①">fully visible</a> in <var>S</var> nor <a data-link-type="dfn" href="#fully-clipped" id="ref-for-fully-clipped①">fully clipped</a> in <var>S</var>. </div>
   <div class="algorithm" data-algorithm="scroll anchoring bounding rect"> The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="scroll-anchoring-bounding-rect">scroll anchoring bounding rect</dfn> of a DOM node <var>N</var> is <var>N</var>’s <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scrollable-overflow-rectangle" id="ref-for-scrollable-overflow-rectangle">scrollable overflow rectangle</a> if <var>N</var> is a <a data-link-type="dfn" href="https://drafts.csswg.org/css-display-3/#block-box" id="ref-for-block-box①">block box</a>,
	or the bounding rect of its <a data-link-type="dfn">line boxes</a> if <var>N</var> is a text node. </div>
   <h3 class="heading settled" data-level="2.2" id="scroll-adjustment"><span class="secno">2.2. </span><span class="content"> Scroll Adjustment</span><a class="self-link" href="#scroll-adjustment"></a></h3>
   <p>If an anchor node was selected,
then when the anchor node moves,
the browser computes the previous offset <code>y0</code>, and the current offset <code>y1</code>,
of the block start edge of the anchor node’s <a data-link-type="dfn" href="#scroll-anchoring-bounding-rect" id="ref-for-scroll-anchoring-bounding-rect②">scroll anchoring bounding rect</a>,
relative to the block start edge of the scrolling content in the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction" id="ref-for-block-flow-direction">block flow direction</a> of the scroller.</p>
   <p>It then queues an adjustment to the scroll position of <code>y1 - y0</code>,
in the block flow direction,
to be performed at the end of the <a data-link-type="dfn" href="#suppression-window" id="ref-for-suppression-window">suppression window</a>.</p>
   <p>The scroll adjustment is a type of [[cssom-view-1#scrolling-events#scrolling]] as defined by <a data-link-type="biblio" href="#biblio-cssom-view">[CSSOM-VIEW]</a>,
and generates <a class="idl-code" data-link-type="event" href="https://drafts.csswg.org/cssom-view-1/#eventdef-document-scroll" id="ref-for-eventdef-document-scroll">scroll events</a> in the manner described there.</p>
   <h4 class="heading settled" data-level="2.2.1" id="suppression-windows"><span class="secno">2.2.1. </span><span class="content"> Suppression Window</span><a class="self-link" href="#suppression-windows"></a></h4>
   <p>Every movement of an anchor node occurs within a window of time
called the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="suppression-window">suppression window</dfn>,
defined as follows:</p>
   <ul>
    <li data-md>
     <p>The suppression window begins at the start of the current iteration of the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#processing-model-8">HTML Processing Model</a> event loop,
or at the end of the most recently completed suppression window,
whichever is more recent.</p>
    <li data-md>
     <p>The suppression window ends at the end of the current iteration of the <a href="https://html.spec.whatwg.org/multipage/webappapis.html#processing-model-8">HTML Processing Model</a> event loop,
or immediately before the next operation whose result or side effects
would differ as a result of a change in the scroll position
(for example, an invocation of <code class="idl"><a data-link-type="idl" href="https://drafts.csswg.org/cssom-view-1/#dom-element-getboundingclientrect" id="ref-for-dom-element-getboundingclientrect">getBoundingClientRect()</a></code>),
whichever comes sooner.</p>
   </ul>
   <p class="note" role="note"><span>Note:</span> The suppression window boundaries should be incorporated into the HTML standard once the
scroll anchoring API is stabilized.</p>
   <p>More than one anchor node movement may occur within the same suppression window.</p>
   <p>At the end of a suppression window,
the user agent performs all scroll adjustments that were queued during the window
and not suppressed by any <a data-link-type="dfn" href="#suppression-trigger" id="ref-for-suppression-trigger">suppression trigger</a> during the window.</p>
   <h4 class="heading settled" data-level="2.2.2" id="suppression-triggers"><span class="secno">2.2.2. </span><span class="content"> Suppression Triggers</span><a class="self-link" href="#suppression-triggers"></a></h4>
   <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="suppression-trigger">suppression trigger</dfn> is an operation
that suppresses the scroll anchoring adjustment for an anchor node movement,
if it occurs within the suppression window for that movement.
These triggers are:</p>
   <ul>
    <li data-md>
     <p>Any change to the computed value of any of the following properties,
on any element in the path from the anchor node to the scrollable element (or document),
inclusive of both:</p>
     <ul>
      <li data-md>
       <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-top" id="ref-for-propdef-top">top</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-left" id="ref-for-propdef-left">left</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-right" id="ref-for-propdef-right">right</a>, or <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-bottom" id="ref-for-propdef-bottom">bottom</a></p>
      <li data-md>
       <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-box-3/#propdef-margin" id="ref-for-propdef-margin">margin</a> or its longhands</p>
      <li data-md>
       <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-box-3/#propdef-padding" id="ref-for-propdef-padding">padding</a> or its longhands</p>
      <li data-md>
       <p><a class="property" data-link-type="propdesc">width</a>, <span class="property">height</span>, <span class="property">min-width</span>, <span class="property">max-width</span>, <span class="property">min-height</span>, or <span class="property">max-height</span></p>
      <li data-md>
       <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-position" id="ref-for-propdef-position②">position</a></p>
      <li data-md>
       <p><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-transforms-1/#propdef-transform" id="ref-for-propdef-transform">transform</a></p>
     </ul>
    <li data-md>
     <p>Any change to the computed value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-position-3/#propdef-position" id="ref-for-propdef-position③">position</a> property
on any element within the scrollable element (or document),
such that the element becomes or stops being absolutely positioned.
Note that this trigger applies regardless of whether the modified element is
on the path from the anchor node to the scrollable element.</p>
   </ul>
   <p class="note" role="note"><span>Note:</span> Suppression triggers exist for compatibility with existing web content that has negative
interactions with scroll anchoring due to shifting content in scroll event handlers.</p>
   <h2 class="heading settled" data-level="3" id="exclusion-api"><span class="secno">3. </span><span class="content"> Exclusion API</span><a class="self-link" href="#exclusion-api"></a></h2>
   <p>Scroll anchoring aims to be the default mode of behavior when launched,
so that users benefit from it even on legacy content. <a class="property" data-link-type="propdesc" href="#propdef-overflow-anchor" id="ref-for-propdef-overflow-anchor②">overflow-anchor</a> can disable scroll anchoring in part or all of a webpage (opt out),
or exclude portions of the DOM from the anchor node selection algorithm.</p>
   <table class="def propdef" data-link-for-hint="overflow-anchor">
    <tbody>
     <tr>
      <th>Name:
      <td><dfn class="dfn-paneled css" data-dfn-type="property" data-export id="propdef-overflow-anchor">overflow-anchor</dfn>
     <tr class="value">
      <th><a href="https://drafts.csswg.org/css-values/#value-defs">Value:</a>
      <td class="prod">auto <a data-link-type="grammar" href="https://drafts.csswg.org/css-values-4/#comb-one" id="ref-for-comb-one">|</a> none
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#initial-values">Initial:</a>
      <td>auto
     <tr>
      <th>Applies to:
      <td><a href="https://drafts.csswg.org/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#inherited-property">Inherited:</a>
      <td>no
     <tr>
      <th><a href="https://drafts.csswg.org/css-values/#percentages">Percentages:</a>
      <td>n/a
     <tr>
      <th><a href="https://drafts.csswg.org/css-cascade/#computed">Computed value:</a>
      <td>specified keyword
     <tr>
      <th>Canonical order:
      <td>per grammar
     <tr>
      <th><a href="https://drafts.csswg.org/web-animations/#animation-type">Animation type:</a>
      <td>discrete
   </table>
   <p>Values are defined as follows:</p>
   <dl>
    <dt data-md><dfn class="css" data-dfn-for="overflow-anchor" data-dfn-type="value" data-export id="valdef-overflow-anchor-auto">auto<a class="self-link" href="#valdef-overflow-anchor-auto"></a></dfn>
    <dd data-md>
     <p>Declares that the element
is potentially eligible to participate in the <a data-link-type="dfn" href="#anchoring-algorithm" id="ref-for-anchoring-algorithm">anchor node selection algorithm</a> for any scrolling box created by the element or an ancestor.</p>
    <dt data-md><dfn class="dfn-paneled css" data-dfn-for="overflow-anchor" data-dfn-type="value" data-export id="valdef-overflow-anchor-none">none</dfn>
    <dd data-md>
     <p>Declares that the element and its descendants
(that aren’t nested inside of another scrolling element)
are <em>not</em> eligible to participate in the <a data-link-type="dfn" href="#anchoring-algorithm" id="ref-for-anchoring-algorithm①">anchor node selection algorithm</a> for any scrolling box created by the element or an ancestor.</p>
   </dl>
   <p class="note" role="note"><span>Note:</span> It is not possible to turn scroll anchoring "back on"
for descendants of a <a class="css" data-link-type="propdesc" href="#propdef-overflow-anchor" id="ref-for-propdef-overflow-anchor③">overflow-anchor: none</a> element.
However, descendant <a data-link-type="dfn" href="https://drafts.csswg.org/css-overflow-3/#scroll-container" id="ref-for-scroll-container">scroll containers</a> automatically "turn it back on"
(for their own scrolling box)
unless they explicitly have <span class="css" id="ref-for-propdef-overflow-anchor④">overflow-anchor: none</span> set on them as well.</p>
   <p class="note" role="note"><span>Note:</span> The <code>overflow-anchor</code> property was also proposed (with different values)
for <a href="http://tabatkins.github.io/specs/css-sticky-scrollbars/">CSS Sticky Scrollbars</a>,
which has now been <a href="https://tabatkins.github.io/specs/css-sticky-scrollbars/#intro">superseded</a>.</p>
   <h2 class="heading settled" data-level="4" id="priv-sec"><span class="secno">4. </span><span class="content"> Privacy and Security Considerations</span><a class="self-link" href="#priv-sec"></a></h2>
   <p>This specification,
as it only adjusts how we compute scroll positions,
introduces no new privacy or security considerations.</p>
  </main>
  <h2 class="no-ref no-num heading settled" id="conformance"><span class="content"> Conformance</span><a class="self-link" href="#conformance"></a></h2>
  <h3 class="heading settled" id="document-conventions"><span class="content"> Document conventions</span><a class="self-link" href="#document-conventions"></a></h3>
  <p>Conformance requirements are expressed with a combination of
	descriptive assertions and RFC 2119 terminology. The key words “MUST”,
	“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
	“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
	document are to be interpreted as described in RFC 2119.
	However, for readability, these words do not appear in all uppercase
	letters in this specification. </p>
  <p>All of the text of this specification is normative except sections
	explicitly marked as non-normative, examples, and notes. <a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a> </p>
  <p>Examples in this specification are introduced with the words “for example”
	or are set apart from the normative text with <code>class="example"</code>,
	like this: </p>
  <div class="example" id="example-ae2b6bc0">
   <a class="self-link" href="#example-ae2b6bc0"></a> 
   <p>This is an example of an informative example. </p>
  </div>
  <p>Informative notes begin with the word “Note” and are set apart from the
	normative text with <code>class="note"</code>, like this: </p>
  <p class="note" role="note">Note, this is an informative note. </p>
  <p>Advisements are normative sections styled to evoke special attention and are
	set apart from other normative text with <code>&lt;strong class="advisement"></code>, like
	this: <strong class="advisement"> UAs MUST provide an accessible alternative. </strong> </p>
  <h3 class="heading settled" id="conform-classes"><span class="content"> Conformance classes</span><a class="self-link" href="#conform-classes"></a></h3>
  <p>Conformance to this specification
	is defined for three conformance classes: </p>
  <dl>
   <dt>style sheet 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#style-sheet">CSS
			style sheet</a>. 
   <dt>renderer 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that interprets the semantics of a style sheet and renders
			documents that use them. 
   <dt>authoring tool 
   <dd>A <a href="http://www.w3.org/TR/CSS2/conform.html#user-agent">UA</a> that writes a style sheet. 
  </dl>
  <p>A style sheet is conformant to this specification
	if all of its statements that use syntax defined in this module are valid
	according to the generic CSS grammar and the individual grammars of each
	feature defined in this module. </p>
  <p>A renderer is conformant to this specification
	if, in addition to interpreting the style sheet as defined by the
	appropriate specifications, it supports all the features defined
	by this specification by parsing them correctly
	and rendering the document accordingly. However, the inability of a
	UA to correctly render a document due to limitations of the device
	does not make the UA non-conformant. (For example, a UA is not
	required to render color on a monochrome monitor.) </p>
  <p>An authoring tool is conformant to this specification
	if it writes style sheets that are syntactically correct according to the
	generic CSS grammar and the individual grammars of each feature in
	this module, and meet all other conformance requirements of style sheets
	as described in this module. </p>
  <h3 class="heading settled" id="conform-responsible"><span class="content"> Requirements for Responsible Implementation of CSS</span><a class="self-link" href="#conform-responsible"></a></h3>
  <p>The following sections define several conformance requirements
		for implementing CSS responsibly,
		in a way that promotes interoperability in the present and future. </p>
  <h4 class="heading settled" id="conform-partial"><span class="content"> Partial Implementations</span><a class="self-link" href="#conform-partial"></a></h4>
  <p>So that authors can exploit the forward-compatible parsing rules to assign fallback values, <strong>CSS renderers <em>must</em> treat as invalid
		(and <a href="http://www.w3.org/TR/CSS2/conform.html#ignore">ignore as appropriate</a>)
		any at-rules, properties, property values, keywords, and other syntactic constructs
		for which they have no usable level of support</strong>.
		In particular, user agents <em>must not</em> selectively ignore
		unsupported property values and honor supported values in a single multi-value property declaration:
		if any value is considered invalid (as unsupported values must be),
		CSS requires that the entire declaration be ignored. </p>
  <h4 class="heading settled" id="conform-future-proofing"><span class="content"> Implementations of Unstable and Proprietary Features</span><a class="self-link" href="#conform-future-proofing"></a></h4>
  <p>To avoid clashes with future stable CSS features,
		the CSSWG recommends <a href="http://www.w3.org/TR/CSS/#future-proofing">following best practices</a> for the implementation of <a href="http://www.w3.org/TR/CSS/#unstable">unstable</a> features and <a href="http://www.w3.org/TR/CSS/#proprietary-extension">proprietary extensions</a> to CSS. </p>
  <h4 class="heading settled" id="conform-testing"><span class="content"> Implementations of CR-level Features</span><a class="self-link" href="#conform-testing"></a></h4>
  <p>Once a specification reaches the Candidate Recommendation stage,
		implementers should release an <a data-link-type="dfn" href="http://www.w3.org/TR/CSS/#vendor-prefix">unprefixed</a> implementation
		of any CR-level feature they can demonstrate
		to be correctly implemented according to spec,
		and should avoid exposing a prefixed variant of that feature. </p>
  <p>To establish and maintain the interoperability of CSS across
		implementations, the CSS Working Group requests that non-experimental
		CSS renderers submit an implementation report (and, if necessary, the
		testcases used for that implementation report) to the W3C before
		releasing an unprefixed implementation of any CSS features. Testcases
		submitted to W3C are subject to review and correction by the CSS
		Working Group. </p>
  <p>
   Further information on submitting testcases and implementation reports
		can be found from on the CSS Working Group’s website at <a href="http://www.w3.org/Style/CSS/Test/">http://www.w3.org/Style/CSS/Test/</a>.
		Questions should be directed to the <a href="http://lists.w3.org/Archives/Public/public-css-testsuite">public-css-testsuite@w3.org</a> mailing list. 
<script src="https://www.w3.org/scripts/TR/2016/fixup.js"></script>
  </p>
  <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
  <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
  <ul class="index">
   <li><a href="#scroll-anchoring-anchor-node">anchor node</a><span>, in §2</span>
   <li><a href="#anchoring-algorithm">anchor node selection algorithm</a><span>, in §2.1</span>
   <li><a href="#valdef-overflow-anchor-auto">auto</a><span>, in §3</span>
   <li><a href="#candidate-examination">candidate examination algorithm</a><span>, in §2.1</span>
   <li><a href="#excluded-subtree">excluded subtree</a><span>, in §2.1</span>
   <li><a href="#fully-clipped">fully clipped</a><span>, in §2.1</span>
   <li><a href="#fully-visible">fully visible</a><span>, in §2.1</span>
   <li><a href="#valdef-overflow-anchor-none">none</a><span>, in §3</span>
   <li><a href="#propdef-overflow-anchor">overflow-anchor</a><span>, in §3</span>
   <li><a href="#partially-visible">partially visible</a><span>, in §2.1</span>
   <li><a href="#scroll-anchoring-bounding-rect">scroll anchoring bounding rect</a><span>, in §2.1</span>
   <li><a href="#suppression-trigger">suppression trigger</a><span>, in §2.2.2</span>
   <li><a href="#suppression-window">suppression window</a><span>, in §2.2.1</span>
  </ul>
  <aside class="dfn-panel" data-for="term-for-content-area">
   <a href="https://drafts.csswg.org/css-box-3/#content-area">https://drafts.csswg.org/css-box-3/#content-area</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-content-area">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-margin">
   <a href="https://drafts.csswg.org/css-box-3/#propdef-margin">https://drafts.csswg.org/css-box-3/#propdef-margin</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-margin">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-padding">
   <a href="https://drafts.csswg.org/css-box-3/#propdef-padding">https://drafts.csswg.org/css-box-3/#propdef-padding</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-padding">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-block-box">
   <a href="https://drafts.csswg.org/css-display-3/#block-box">https://drafts.csswg.org/css-display-3/#block-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-block-box">2.1. 
Anchor Node Selection</a> <a href="#ref-for-block-box①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-containing-block">
   <a href="https://drafts.csswg.org/css-display-3/#containing-block">https://drafts.csswg.org/css-display-3/#containing-block</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-containing-block">2.1. 
Anchor Node Selection</a> <a href="#ref-for-containing-block①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-display">
   <a href="https://drafts.csswg.org/css-display-3/#propdef-display">https://drafts.csswg.org/css-display-3/#propdef-display</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-display">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-display-none">
   <a href="https://drafts.csswg.org/css-display-3/#valdef-display-none">https://drafts.csswg.org/css-display-3/#valdef-display-none</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-display-none">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-text-nodes">
   <a href="https://drafts.csswg.org/css-display-3/#text-nodes">https://drafts.csswg.org/css-display-3/#text-nodes</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-text-nodes">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-scroll-container">
   <a href="https://drafts.csswg.org/css-overflow-3/#scroll-container">https://drafts.csswg.org/css-overflow-3/#scroll-container</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-container">3. 
Exclusion API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-scrollable-overflow-rectangle">
   <a href="https://drafts.csswg.org/css-overflow-3/#scrollable-overflow-rectangle">https://drafts.csswg.org/css-overflow-3/#scrollable-overflow-rectangle</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scrollable-overflow-rectangle">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-position-absolute">
   <a href="https://drafts.csswg.org/css-position-3/#valdef-position-absolute">https://drafts.csswg.org/css-position-3/#valdef-position-absolute</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-position-absolute">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-bottom">
   <a href="https://drafts.csswg.org/css-position-3/#propdef-bottom">https://drafts.csswg.org/css-position-3/#propdef-bottom</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-bottom">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-valdef-position-fixed">
   <a href="https://drafts.csswg.org/css-position-3/#valdef-position-fixed">https://drafts.csswg.org/css-position-3/#valdef-position-fixed</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-position-fixed">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-left">
   <a href="https://drafts.csswg.org/css-position-3/#propdef-left">https://drafts.csswg.org/css-position-3/#propdef-left</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-left">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-position">
   <a href="https://drafts.csswg.org/css-position-3/#propdef-position">https://drafts.csswg.org/css-position-3/#propdef-position</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-position">2.1. 
Anchor Node Selection</a> <a href="#ref-for-propdef-position①">(2)</a>
    <li><a href="#ref-for-propdef-position②">2.2.2. 
Suppression Triggers</a> <a href="#ref-for-propdef-position③">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-right">
   <a href="https://drafts.csswg.org/css-position-3/#propdef-right">https://drafts.csswg.org/css-position-3/#propdef-right</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-right">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-top">
   <a href="https://drafts.csswg.org/css-position-3/#propdef-top">https://drafts.csswg.org/css-position-3/#propdef-top</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-top">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-optimal-viewing-region">
   <a href="https://drafts.csswg.org/css-scroll-snap-1/#optimal-viewing-region">https://drafts.csswg.org/css-scroll-snap-1/#optimal-viewing-region</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-optimal-viewing-region">2.1. 
Anchor Node Selection</a> <a href="#ref-for-optimal-viewing-region①">(2)</a> <a href="#ref-for-optimal-viewing-region②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-scroll-padding">
   <a href="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding">https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-scroll-padding">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-propdef-transform">
   <a href="https://drafts.csswg.org/css-transforms-1/#propdef-transform">https://drafts.csswg.org/css-transforms-1/#propdef-transform</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-transform">2.2.2. 
Suppression Triggers</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-comb-one">
   <a href="https://drafts.csswg.org/css-values-4/#comb-one">https://drafts.csswg.org/css-values-4/#comb-one</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-comb-one">3. 
Exclusion API</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-block-flow-direction">
   <a href="https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction">https://drafts.csswg.org/css-writing-modes-4/#block-flow-direction</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-block-flow-direction">2.2. 
Scroll Adjustment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-dom-element-getboundingclientrect">
   <a href="https://drafts.csswg.org/cssom-view-1/#dom-element-getboundingclientrect">https://drafts.csswg.org/cssom-view-1/#dom-element-getboundingclientrect</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-dom-element-getboundingclientrect">2.2.1. 
Suppression Window</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-eventdef-document-scroll">
   <a href="https://drafts.csswg.org/cssom-view-1/#eventdef-document-scroll">https://drafts.csswg.org/cssom-view-1/#eventdef-document-scroll</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-eventdef-document-scroll">2.2. 
Scroll Adjustment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-scrolling-box">
   <a href="https://drafts.csswg.org/cssom-view-1/#scrolling-box">https://drafts.csswg.org/cssom-view-1/#scrolling-box</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scrolling-box①">2.1. 
Anchor Node Selection</a> <a href="#ref-for-scrolling-box②">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="term-for-concept-tree-descendant">
   <a href="https://dom.spec.whatwg.org/#concept-tree-descendant">https://dom.spec.whatwg.org/#concept-tree-descendant</a><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-concept-tree-descendant">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
  <ul class="index">
   <li>
    <a data-link-type="biblio">[css-box-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-content-area" style="color:initial">content area</span>
     <li><span class="dfn-paneled" id="term-for-propdef-margin" style="color:initial">margin</span>
     <li><span class="dfn-paneled" id="term-for-propdef-padding" style="color:initial">padding</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-display-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-block-box" style="color:initial">block box</span>
     <li><span class="dfn-paneled" id="term-for-containing-block" style="color:initial">containing block</span>
     <li><span class="dfn-paneled" id="term-for-propdef-display" style="color:initial">display</span>
     <li><span class="dfn-paneled" id="term-for-valdef-display-none" style="color:initial">none</span>
     <li><span class="dfn-paneled" id="term-for-text-nodes" style="color:initial">text node</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-overflow-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-scroll-container" style="color:initial">scroll container</span>
     <li><span class="dfn-paneled" id="term-for-scrollable-overflow-rectangle" style="color:initial">scrollable overflow rectangle</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-position-3]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-valdef-position-absolute" style="color:initial">absolute</span>
     <li><span class="dfn-paneled" id="term-for-propdef-bottom" style="color:initial">bottom</span>
     <li><span class="dfn-paneled" id="term-for-valdef-position-fixed" style="color:initial">fixed</span>
     <li><span class="dfn-paneled" id="term-for-propdef-left" style="color:initial">left</span>
     <li><span class="dfn-paneled" id="term-for-propdef-position" style="color:initial">position</span>
     <li><span class="dfn-paneled" id="term-for-propdef-right" style="color:initial">right</span>
     <li><span class="dfn-paneled" id="term-for-propdef-top" style="color:initial">top</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-scroll-snap-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-optimal-viewing-region" style="color:initial">optimal viewing region</span>
     <li><span class="dfn-paneled" id="term-for-propdef-scroll-padding" style="color:initial">scroll-padding</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-transforms-1]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-propdef-transform" style="color:initial">transform</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-values-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-comb-one" style="color:initial">|</span>
    </ul>
   <li>
    <a data-link-type="biblio">[css-writing-modes-4]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-block-flow-direction" style="color:initial">block flow direction</span>
    </ul>
   <li>
    <a data-link-type="biblio">[CSSOM-VIEW]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-dom-element-getboundingclientrect" style="color:initial">getBoundingClientRect()</span>
     <li><span class="dfn-paneled" id="term-for-eventdef-document-scroll" style="color:initial">scroll</span>
     <li><span class="dfn-paneled" id="term-for-scrolling-box" style="color:initial">scrolling box</span>
    </ul>
   <li>
    <a data-link-type="biblio">[DOM]</a> defines the following terms:
    <ul>
     <li><span class="dfn-paneled" id="term-for-concept-tree-descendant" style="color:initial">descendant</span>
    </ul>
  </ul>
  <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2>
  <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
  <dl>
   <dt id="biblio-css-box-3">[CSS-BOX-3]
   <dd>Elika Etemad. <a href="https://www.w3.org/TR/css-box-3/">CSS Box Model Module Level 3</a>. 18 December 2018. WD. URL: <a href="https://www.w3.org/TR/css-box-3/">https://www.w3.org/TR/css-box-3/</a>
   <dt id="biblio-css-display-3">[CSS-DISPLAY-3]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-display-3/">CSS Display Module Level 3</a>. 28 August 2018. CR. URL: <a href="https://www.w3.org/TR/css-display-3/">https://www.w3.org/TR/css-display-3/</a>
   <dt id="biblio-css-overflow-3">[CSS-OVERFLOW-3]
   <dd>David Baron; Elika Etemad; Florian Rivoal. <a href="https://www.w3.org/TR/css-overflow-3/">CSS Overflow Module Level 3</a>. 31 July 2018. WD. URL: <a href="https://www.w3.org/TR/css-overflow-3/">https://www.w3.org/TR/css-overflow-3/</a>
   <dt id="biblio-css-position-3">[CSS-POSITION-3]
   <dd>Rossen Atanassov; Arron Eicholz. <a href="https://www.w3.org/TR/css-position-3/">CSS Positioned Layout Module Level 3</a>. 17 May 2016. WD. URL: <a href="https://www.w3.org/TR/css-position-3/">https://www.w3.org/TR/css-position-3/</a>
   <dt id="biblio-css-scroll-snap-1">[CSS-SCROLL-SNAP-1]
   <dd>Matt Rakow; et al. <a href="https://www.w3.org/TR/css-scroll-snap-1/">CSS Scroll Snap Module Level 1</a>. 19 March 2019. CR. URL: <a href="https://www.w3.org/TR/css-scroll-snap-1/">https://www.w3.org/TR/css-scroll-snap-1/</a>
   <dt id="biblio-css-transforms-1">[CSS-TRANSFORMS-1]
   <dd>Simon Fraser; et al. <a href="https://www.w3.org/TR/css-transforms-1/">CSS Transforms Module Level 1</a>. 14 February 2019. CR. URL: <a href="https://www.w3.org/TR/css-transforms-1/">https://www.w3.org/TR/css-transforms-1/</a>
   <dt id="biblio-css-values-4">[CSS-VALUES-4]
   <dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 31 January 2019. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
   <dt id="biblio-css-writing-modes-4">[CSS-WRITING-MODES-4]
   <dd>Elika Etemad; Koji Ishii. <a href="https://www.w3.org/TR/css-writing-modes-4/">CSS Writing Modes Level 4</a>. 24 May 2018. CR. URL: <a href="https://www.w3.org/TR/css-writing-modes-4/">https://www.w3.org/TR/css-writing-modes-4/</a>
   <dt id="biblio-cssom-view">[CSSOM-VIEW]
   <dd>Simon Pieters. <a href="https://www.w3.org/TR/cssom-view-1/">CSSOM View Module</a>. 17 March 2016. WD. URL: <a href="https://www.w3.org/TR/cssom-view-1/">https://www.w3.org/TR/cssom-view-1/</a>
   <dt id="biblio-dom">[DOM]
   <dd>Anne van Kesteren. <a href="https://dom.spec.whatwg.org/">DOM Standard</a>. Living Standard. URL: <a href="https://dom.spec.whatwg.org/">https://dom.spec.whatwg.org/</a>
   <dt id="biblio-rfc2119">[RFC2119]
   <dd>S. Bradner. <a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://tools.ietf.org/html/rfc2119">https://tools.ietf.org/html/rfc2119</a>
  </dl>
  <h2 class="no-num no-ref heading settled" id="property-index"><span class="content">Property Index</span><a class="self-link" href="#property-index"></a></h2>
  <div class="big-element-wrapper">
   <table class="index">
    <thead>
     <tr>
      <th scope="col">Name
      <th scope="col">Value
      <th scope="col">Initial
      <th scope="col">Applies to
      <th scope="col">Inh.
      <th scope="col">%ages
      <th scope="col">Anim­ation type
      <th scope="col">Canonical order
      <th scope="col">Com­puted value
    <tbody>
     <tr>
      <th scope="row"><a class="css" data-link-type="property" href="#propdef-overflow-anchor" id="ref-for-propdef-overflow-anchor⑤">overflow-anchor</a>
      <td>auto | none
      <td>auto
      <td>all elements
      <td>no
      <td>n/a
      <td>discrete
      <td>per grammar
      <td>specified keyword
   </table>
  </div>
  <aside class="dfn-panel" data-for="scroll-anchoring-anchor-node">
   <b><a href="#scroll-anchoring-anchor-node">#scroll-anchoring-anchor-node</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-anchoring-anchor-node">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="anchoring-algorithm">
   <b><a href="#anchoring-algorithm">#anchoring-algorithm</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-anchoring-algorithm">3. 
Exclusion API</a> <a href="#ref-for-anchoring-algorithm①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="candidate-examination">
   <b><a href="#candidate-examination">#candidate-examination</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-candidate-examination">2.1. 
Anchor Node Selection</a> <a href="#ref-for-candidate-examination①">(2)</a> <a href="#ref-for-candidate-examination②">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="excluded-subtree">
   <b><a href="#excluded-subtree">#excluded-subtree</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-excluded-subtree">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fully-visible">
   <b><a href="#fully-visible">#fully-visible</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fully-visible">2.1. 
Anchor Node Selection</a> <a href="#ref-for-fully-visible①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="fully-clipped">
   <b><a href="#fully-clipped">#fully-clipped</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-fully-clipped">2.1. 
Anchor Node Selection</a> <a href="#ref-for-fully-clipped①">(2)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="partially-visible">
   <b><a href="#partially-visible">#partially-visible</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-partially-visible">2.1. 
Anchor Node Selection</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="scroll-anchoring-bounding-rect">
   <b><a href="#scroll-anchoring-bounding-rect">#scroll-anchoring-bounding-rect</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-scroll-anchoring-bounding-rect">2.1. 
Anchor Node Selection</a> <a href="#ref-for-scroll-anchoring-bounding-rect①">(2)</a>
    <li><a href="#ref-for-scroll-anchoring-bounding-rect②">2.2. 
Scroll Adjustment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="suppression-window">
   <b><a href="#suppression-window">#suppression-window</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-suppression-window">2.2. 
Scroll Adjustment</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="suppression-trigger">
   <b><a href="#suppression-trigger">#suppression-trigger</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-suppression-trigger">2.2.1. 
Suppression Window</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="propdef-overflow-anchor">
   <b><a href="#propdef-overflow-anchor">#propdef-overflow-anchor</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-propdef-overflow-anchor">2.1. 
Anchor Node Selection</a> <a href="#ref-for-propdef-overflow-anchor①">(2)</a>
    <li><a href="#ref-for-propdef-overflow-anchor②">3. 
Exclusion API</a> <a href="#ref-for-propdef-overflow-anchor③">(2)</a> <a href="#ref-for-propdef-overflow-anchor④">(3)</a>
   </ul>
  </aside>
  <aside class="dfn-panel" data-for="valdef-overflow-anchor-none">
   <b><a href="#valdef-overflow-anchor-none">#valdef-overflow-anchor-none</a></b><b>Referenced in:</b>
   <ul>
    <li><a href="#ref-for-valdef-overflow-anchor-none">2.1. 
Anchor Node Selection</a> <a href="#ref-for-valdef-overflow-anchor-none①">(2)</a>
   </ul>
  </aside>
<script>/* script-var-click-highlighting */

    document.addEventListener("click", e=>{
        if(e.target.nodeName == "VAR") {
            highlightSameAlgoVars(e.target);
        }
    });
    {
        const indexCounts = new Map();
        const indexNames = new Map();
        function highlightSameAlgoVars(v) {
            // Find the algorithm container.
            let algoContainer = null;
            let searchEl = v;
            while(algoContainer == null && searchEl != document.body) {
                searchEl = searchEl.parentNode;
                if(searchEl.hasAttribute("data-algorithm")) {
                    algoContainer = searchEl;
                }
            }

            // Not highlighting document-global vars,
            // too likely to be unrelated.
            if(algoContainer == null) return;

            const algoName = algoContainer.getAttribute("data-algorithm");
            const varName = getVarName(v);
            const addClass = !v.classList.contains("selected");
            let highlightClass = null;
            if(addClass) {
                const index = chooseHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] += 1;
                indexNames.set(algoName+"///"+varName, index);
                highlightClass = nameFromIndex(index);
            } else {
                const index = previousHighlightIndex(algoName, varName);
                indexCounts.get(algoName)[index] -= 1;
                highlightClass = nameFromIndex(index);
            }

            // Find all same-name vars, and toggle their class appropriately.
            for(const el of algoContainer.querySelectorAll("var")) {
                if(getVarName(el) == varName) {
                    el.classList.toggle("selected", addClass);
                    el.classList.toggle(highlightClass, addClass);
                }
            }
        }
        function getVarName(el) {
            return el.textContent.replace(/(\s| )+/, " ").trim();
        }
        function chooseHighlightIndex(algoName, varName) {
            let indexes = null;
            if(indexCounts.has(algoName)) {
                indexes = indexCounts.get(algoName);
            } else {
                // 7 classes right now
                indexes = [0,0,0,0,0,0,0];
                indexCounts.set(algoName, indexes);
            }

            // If the element was recently unclicked,
            // *and* that color is still unclaimed,
            // give it back the same color.
            const lastIndex = previousHighlightIndex(algoName, varName);
            if(indexes[lastIndex] === 0) return lastIndex;

            // Find the earliest index with the lowest count.
            const minCount = Math.min.apply(null, indexes);
            let index = null;
            for(var i = 0; i < indexes.length; i++) {
                if(indexes[i] == minCount) {
                    return i;
                }
            }
        }
        function previousHighlightIndex(algoName, varName) {
            return indexNames.get(algoName+"///"+varName);
        }
        function nameFromIndex(index) {
            return "selected" + index;
        }
    }
    </script>
<script>/* script-dfn-panel */

document.body.addEventListener("click", function(e) {
    var queryAll = function(sel) { return [].slice.call(document.querySelectorAll(sel)); }
    // Find the dfn element or panel, if any, that was clicked on.
    var el = e.target;
    var target;
    var hitALink = false;
    while(el.parentElement) {
        if(el.tagName == "A") {
            // Clicking on a link in a <dfn> shouldn't summon the panel
            hitALink = true;
        }
        if(el.classList.contains("dfn-paneled")) {
            target = "dfn";
            break;
        }
        if(el.classList.contains("dfn-panel")) {
            target = "dfn-panel";
            break;
        }
        el = el.parentElement;
    }
    if(target != "dfn-panel") {
        // Turn off any currently "on" or "activated" panels.
        queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(function(el){
            el.classList.remove("on");
            el.classList.remove("activated");
        });
    }
    if(target == "dfn" && !hitALink) {
        // open the panel
        var dfnPanel = document.querySelector(".dfn-panel[data-for='" + el.id + "']");
        if(dfnPanel) {
            dfnPanel.classList.add("on");
            var rect = el.getBoundingClientRect();
            dfnPanel.style.left = window.scrollX + rect.right + 5 + "px";
            dfnPanel.style.top = window.scrollY + rect.top + "px";
            var panelRect = dfnPanel.getBoundingClientRect();
            var panelWidth = panelRect.right - panelRect.left;
            if(panelRect.right > document.body.scrollWidth && (rect.left - (panelWidth + 5)) > 0) {
                // Reposition, because the panel is overflowing
                dfnPanel.style.left = window.scrollX + rect.left - (panelWidth + 5) + "px";
            }
        } else {
            console.log("Couldn't find .dfn-panel[data-for='" + el.id + "']");
        }
    } else if(target == "dfn-panel") {
        // Switch it to "activated" state, which pins it.
        el.classList.add("activated");
        el.style.left = null;
        el.style.top = null;
    }

});
</script>